package com.ruoyi.cscec.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cscec.mapper.SurveyOrderMapper;
import com.ruoyi.cscec.domain.SurveyOrder;
import com.ruoyi.cscec.service.ISurveyOrderService;

/**
 * 调查工单Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-27
 */
@Service
public class SurveyOrderServiceImpl implements ISurveyOrderService
{
    @Autowired
    private SurveyOrderMapper surveyOrderMapper;

    /**
     * 查询调查工单
     *
     * @param id 调查工单主键
     * @return 调查工单
     */
    @Override
    public SurveyOrder selectSurveyOrderById(Long id)
    {
        return surveyOrderMapper.selectSurveyOrderById(id);
    }

    /**
     * 查询调查工单列表
     *
     * @param surveyOrder 调查工单
     * @return 调查工单
     */
    @Override
    public List<SurveyOrder> selectSurveyOrderList(SurveyOrder surveyOrder)
    {
        return surveyOrderMapper.selectSurveyOrderList(surveyOrder);
    }

    /**
     * 新增调查工单
     *
     * @param surveyOrder 调查工单
     * @return 结果
     */
    @Override
    public int insertSurveyOrder(SurveyOrder surveyOrder)
    {
        surveyOrder.setCreateTime(DateUtils.getNowDate());
        return surveyOrderMapper.insertSurveyOrder(surveyOrder);
    }

    /**
     * 修改调查工单
     *
     * @param surveyOrder 调查工单
     * @return 结果
     */
    @Override
    public int updateSurveyOrder(SurveyOrder surveyOrder)
    {
        return surveyOrderMapper.updateSurveyOrder(surveyOrder);
    }

    /**
     * 批量删除调查工单
     *
     * @param ids 需要删除的调查工单主键
     * @return 结果
     */
    @Override
    public int deleteSurveyOrderByIds(Long[] ids)
    {
        return surveyOrderMapper.deleteSurveyOrderByIds(ids);
    }

    /**
     * 删除调查工单信息
     *
     * @param id 调查工单主键
     * @return 结果
     */
    @Override
    public int deleteSurveyOrderById(Long id)
    {
        return surveyOrderMapper.deleteSurveyOrderById(id);
    }
}
